import datetime
year = int(input())
month = int(input())
day = int(input())
d0 = datetime.date(1970,1,1)
d1 = datetime.date(year,month,day)
print((d1-d0).days)